#include "columns.h"

#include <QVariant>

#include "common.h"


namespace BitWin
{


//---- Bits column class

BitsColumn::BitsColumn(
    const QString& title_, const BitRange& range_
):
    Column(title_),
    _range(range_)
{}

QVariant BitsColumn::data(
    int role, const Row* row, const PRowText& data_
) const
{
    return row->data(role, _range, data_);
}

bool BitsColumn::operator==(const BitsColumn& rhs) const
{
    return (
        (rhs._range == this->_range) &&
        Column::operator==(rhs)
    );
}

QString BitsColumn::repr() const
{
    return QString("BitsColumn instance, title: \"%1\", range: %2")
        .arg(title())
        .arg(_range.repr())
    ;
}


}
